<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
<?=$page_title?>
</title>
<base href="<?=base_url()?>" />
<script type="text/javascript" src="js/jquery.js"></script>
<!--time-->
<link rel="stylesheet" href="themes/base/jquery.ui.all.css">
<script src="js/ui/jquery.ui.core.js"></script>
<script src="js/ui/jquery.ui.widget.js"></script>
<script src="js/ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="css/demos.css">
<!--弹窗-->
<link href="css/clientpublic.css" rel="stylesheet" type="text/css">
<link href="css/esui.css" rel="stylesheet" type="text/css">
<link href="css/initaccount.css" rel="stylesheet" type="text/css">
<link href="css/guo.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox-1.3.4.css" />
<link rel="stylesheet" type="text/css" href="css/jia.css" />
<script type="text/javascript">
	$(document).ready(function() {
		jQuery.ajaxSetup ({cache:false}); /*让ajax不调用浏览的缓存*/
		$(".various1").fancybox({
		'titleShow'     : false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'hideOnOverlayClick' : false,
		'easingOut'     : 'easeInBack'});

		$(".g_title_sub").click(function(){
            var subject=$.trim($("#name").val());
            if(subject == ""){
              alert("请输入名称后查询");
              $("#name").focus();
            }else{
				location.href="<?=base_url()?>index.php/area/check/"+subject+"";
              }
		})
	});
</script>

</head>
<body>
	<div id="Holder">
		<div id="MainPage">
			<!---------头部------------->
			<?php include('top.php')?>
			<div id="Subnav">
				<ul>
					<li class="active show"></li>
				</ul>
			</div>
			<!---------中间部分------------->
			<div id="MainBody">
				<div class="g_title">
					<div class="g_earch">
						  <input type="text" class="g_title_text"
							value="区域名称" onClick="this.value=''" id="name"><input
							type="button" value=" " class="g_title_sub">
					</div>
					<div class="add_customer">
						<div class="add_customer_bg6"><?=anchor('area/show_customer_add/',' ','class="various1"','id="find"') ?></div>
					</div>
				</div>
				<table id="ContentTable" class="data-box">
					<thead>
						<tr class="border-in">
							<th><div>ID</div></th>
							<th><div>区域名称</div></th>
							<th><div>创建日期</div></th>
							<th><div>更新日期</div></th>
                            <th><div>编辑</div></th>
						</tr>
					</thead>
					<tbody>
					<?php foreach ($area as $item): ?>
					<tr class="data-box-row">
							<td><?= $item->id ?></td>
							<td><?= $item->district ?></td>
							<?php
							if($item->create_time == null || $item->create_time == '' || $item->create_time == '0000-00-00 00:00:00'){
								$create_time = '';
							}else{
								$datatime = strtotime($item->create_time);
								$create_time = date( "Y-m-d",$datatime);
							}
							if($item->update_time == null || $item->update_time == '' || $item->update_time == '0000-00-00 00:00:00'){
								$update_time = '';
							}else{
								$datatime = strtotime($item->update_time);
								$update_time = date( "Y-m-d",$datatime);
							}
							?>
							<td><?= $create_time ?></td>
							<td><?= $update_time ?></td>
							<td>
                            <a href="<?=base_url()?>index.php/area/find/<?= $item->id ?>" class="various1 g_see" id="find" title="">查看</a>&nbsp;&nbsp; 
                            <a href="<?=base_url()?>index.php/area/update/<?= $item->id ?>" class="various1 g_edit" id="find" title="">编辑</a>&nbsp;&nbsp; 
                            <span id="delete<?= $item->id ?>" class="g_dele">删除</span> <input	type="hidden" id="sales_id<?= $item->id ?>"	value="<?= $item->id ?>" /> 				
                            <script	type="text/javascript">
								 $(function(){
									 $("#delete<?= $item->id ?>").click(function(){
										if (window.confirm("您确定要删除吗？")) {
											var id=$("#sales_id<?= $item->id ?>").val();
											location.href="<?= base_url()?>index.php/area/delete/"+id+"";
										} else {
										}
									})
								 })
							 </script>
                             </td>
						</tr>
		          <?php endforeach; ?>
		        </tbody>
				</table>
				<div id="PageControl">
					<div class="page-control">
						<div class="border-in">
							<span class="perpage"> <span class="perpage-text">
							  <?php if($pag_links){?>
								<?echo ($offset) ? ($offset+1):1;?> - <?=$current_total?> 条（共<?=$total?>条）
							<?php }?>
							</span>
							</span>
							<p>
								<?php if($pag_links){
							    	echo $pag_links;
							    }?>
							</p>
						</div>
					</div>
				</div>
			</div>
			<!---------结尾------------->
			<?php include('footer.php')?>
		</div>
	</div>
</body>
</html>
	<script>
	$(function() {
		$( "#datepicker" ).datepicker();
		$("table").delegate('tr',"hover", function(){
			$(this).toggleClass("hover");
		});
	});
	</script>